<%@ page import="com.capgemini.core.AjaxResponse" %>
<%@ page import="com.capgemini.commons.JsonUtil" %>
<%@ page import="org.apache.commons.lang3.StringUtils" %>
<%@ page import="org.slf4j.LoggerFactory" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isErrorPage="true" %>
<%@ page trimDirectiveWhitespaces="true" %>
<%


  boolean isAjax = StringUtils.equalsIgnoreCase(request.getHeader("custom-request-method"), "ajax");

  if(isAjax) {
    AjaxResponse ajaxResponse = new AjaxResponse();

    ajaxResponse.setSuccess(false);
    ajaxResponse.setErrorCode("401");
    ajaxResponse.setMessage("您的登录可能已失效，请重新打开页面后重试！");

    String jsonStr = JsonUtil.getJson(ajaxResponse);

    response.setContentType("application/json;charset=UTF-8");

    out.print(jsonStr);
  }else{
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>
  <meta http-equiv="content-type" content="text/html;charset=utf-8"/>

</head>

<body>
<div style="font-size:24px; font-weight:bold; padding:50px; background: #FFF;">
  403　　Unauthorized.<BR/>
  您的登录可能已失效，请重新打开页面后重试！
</div>
</body>
</html>
<%}%>